import 'package:finance_app/src/entities/assistant_suggest_data_entity.dart';

assistantSuggestDataEntityFromJson(AssistantSuggestDataEntity data, Map<String, dynamic> json) {
	if (json['data_type'] != null) {
		data.dataType = json['data_type'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['type'] != null) {
		data.type = json['type'].toString();
	}
	if (json['question'] != null) {
		data.question = json['question'].toString();
	}
	if (json['answer'] != null) {
		data.answer = (json['answer'] as List).map((v) => v.toString()).toList().cast<String>();
	}
	return data;
}

Map<String, dynamic> assistantSuggestDataEntityToJson(AssistantSuggestDataEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['data_type'] = entity.dataType;
	data['id'] = entity.id;
	data['type'] = entity.type;
	data['question'] = entity.question;
	data['answer'] = entity.answer;
	return data;
}